package com.godpaper.the5elements.model
{
	import de.polygonal.ds.Array2;
	
	import jp.dip.hael.gameai.graph.GraphEx;
	
	import mx.collections.ArrayCollection;

	/**
	 * 
	 * Model data about Board
	 * 
	 */	
	public class BoardModel
	{
		// Singleton instance of BoardModel
		private static var instance:BoardModel;
		public function BoardModel(access:Private)
		{
			if (access != null){
				if (instance == null)
				{				
					instance = this;
				}
			}
			else{
				throw new Error( "BoardModel.SINGLETON_EXCEPTION", "@BoardModel" );
			}
		}
		
		/**
		 * 
		 * @return the Singleton instance of BoardModel
		 * 
		 */		
		public static function getInstance():BoardModel
		{
			if(instance == null)
			{
				instance = new BoardModel(new Private());
			}
			return instance;
		}
//--------------------------------------------------------------------------
//
//  Variables
//
//--------------------------------------------------------------------------	
		[Bindable]public var gamePosition:Array2 = new Array2(6,6);//mapping board and piecesButtons(point,array)
//		[Bindable]public var gameGraph:Graph = new Graph(ButtonFactory.MAX_GASKET_NUM);
		[Bindable]public var gameGraph:GraphEx = new GraphEx();
		[Bindable]public var WITH_DEBUG:Boolean = true;//indicate whether this game with debug func.
		[Bindable]public var gasketsPosition:Array2 = new Array2(6,6);//mapping board and gasketButtons;
		[Bindable]public var walkableGBindexs:ArrayCollection = new ArrayCollection();//store current movemet existed walkable gasketButtons;
	}
}
/**
 * Inner class which restricts contructor access to Private
 */
class Private 
{
	
}